﻿using System;
using System.Collections;
using System.ComponentModel;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Hashtable hashtable = new Hashtable();
            Console.WriteLine("中影梦工坊巨幕影城");
            Console.WriteLine("请选择你所要观看的电影，进行购买");
            Console.WriteLine("请输入电影id");
            
            hashtable.Add(1,"误杀");
            hashtable.Add(2,"两只老虎");
            hashtable.Add(3,"新喜剧之王");
            hashtable.Add(4,"超能失控");
            hashtable.Add(5,"哪吒之魔童转世");
            int id = int.Parse(Console.ReadLine());
            bool movie = hashtable.ContainsKey(id);
            if (movie)
            {
                Console.WriteLine("您所查找的电影名称为{0}", hashtable[id].ToString());
            }
            else 
            {
                Console.WriteLine("您所查找的电影已下播");
            }
            Console.WriteLine("以下为热映电影");
            foreach (DictionaryEntry d in hashtable)
            {
                int key =(int) d.Key;
                string value =(string) d.Value;
                Console.WriteLine("电影id:{0}  电影名称：{1}",key,value);
                
            }

        }
    }
}
